<html>
<head>
<title>Priority Encoder</title>
</head>

<body bgcolor="FFFFFF">

<h1><img  align="center" src="../../../../en/icons/priencod.gif" width="32" height="32">
<em>Priority Encoder</em></h1>

<p><table>
<tr><td><strong>Library:</strong></td>
	<td><a href="index.html">Plexers</a></td></tr>
<tr><td><strong>Introduced:</strong></td>
	<td>2.3.0</td></tr>
<tr><td valign="top"><strong>Appearance:</strong></td>
	<td valign="top"><img src="../../../../en/img-libs/priencod.png" width="44" height="95"></td></tr>
</table></p>

<h2>Behavior</h2>

<p>The component has a number of inputs on its west edge, with the first
labeled <q>0</q> and the other numbered from there. The component determines
the indices of the inputs whose values are 1, and it emits the highest index.
For example, if inputs 0, 2, 5, and 6 are all 1, then the priority encoder
emits a value of 110. If no inputs are 1, or if the component is
disabled, then the output of the priority encoder is floating.</p>

<p>The priority encoder is designed so that a number of encoders can be
daisy-chained to accommodate additional inputs. In particular, the component
includes an enable input and an enable output. Whenever the enable input is 0,
the component is disabled, and the output will be all floating bits. The enable
output is 1 whenever the component is enabled and none of the indexed inputs are
1. Thus, you can take two priority encoders and connect the enable output
of the first to the enable input of the second: If any of the indexed inputs
to the first are 1, then the second will be disabled and so its output will be
all floating. But if none of the first's indexed inputs are 1, then its output
will be all-floating bits, and the second
priority encoder will be enabled and it will identify the highest-priority
input with a 1.</p>

<p>An additional output of the priority encoder is 1 whenever the priority
encoder is enabled and finds a 1 on one of the indexed inputs. When
chaining priority encoders together, this output can be used to identify
which of the encoders was triggered.</p>

<h2>Pins (assuming component faces east)</h2>

<dl>

<dt>West edge, variable number (inputs, bit width 1)</dt>
<dd>Input values, indexed from 0 at the top/west end of the edge.</dd>

<dt>East edge, upper pin (output, bit width matches Select Bits attribute)</dt>
<dd>Output: the highest index among those inputs whose value is 1 - or all
floating bits if no inputs are 1 or if the component is disabled via the
Enable In input.</dd>

<dt>East edge, lower pin (output, bit width 1)</dt>
<dd>Group Signal: 1 if the component is enabled and at least one indexed input
has a value of 1; otherwise this output is 0.</dd>

<dt>South edge (input, bit width 1)</dt>
<dd>Enable In: if 0, the component is disabled; otherwise the component is
enabled.</dd>

<dt>North edge (output, bit width 1)</dt>
<dd>Enable Out: 1 if this component is enabled and none of the indexed inputs
are 1; otherwise the output is 0.</dd>

</dl>

<h2>Attributes</h2>

<p>When the component is selected or being added,
the digits '1' through '4' alter its <q>Select Bits</q> attribute
and the arrow keys alter its <q>Facing</q> attribute.</p>

<dl>

<dt>Facing</dt>
<dd>The direction of the component (its output relative to its input).</dt>

<dt>Select Bits</dt>
<dd>The bit width of the component's primary output.
The number of indexed inputs to the priority encoder will be
2<sup><small><var>selectBits</var></small></sup>.</dt>

<dt>Disabled Output</dt>
<dd>Specifies what each bit of the output should be when the component is
disabled (i.e., when the enable pin is 0). Options include zero and floating;
in the latter case, the output is effectively disconnected from any other ports.</dd>

</dl>

<h2>Poke Tool Behavior</h2>

<p>None.</p>

<h2>Text Tool Behavior</h2>

<p>None.</p>

<p><a href="../index.html">Back to <em>Library Reference</em></a></p>

</body>
</html>
-